package ytdp.careagle.com.ytdp.entity;

import com.google.gson.Gson;

import java.io.Serializable;
import java.util.List;

/**
 * Created by lida on 2017/6/8 0008.
 */

public class ProvinceEntity implements Serializable {

    /**
     * provinceCode : 00001
     * provinceName : 北京
     * extString : {position=110000, location_cn=华北, location=huabei, pinyin=beijing}
     * children : [{"cityCode":"00002","cityName":"北京","extString":"{defaultposition=110100, zipcode=100000, pinyin=beijing_}","provinceCode":"00001"}]
     */

    private String provinceCode;
    private String provinceName;
    private String extString;
    private List<ChildrenBean> children;

    public static ProvinceEntity objectFromData(String str) {

        return new Gson().fromJson(str, ProvinceEntity.class);
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getExtString() {
        return extString;
    }

    public void setExtString(String extString) {
        this.extString = extString;
    }

    public List<ChildrenBean> getChildren() {
        return children;
    }

    public void setChildren(List<ChildrenBean> children) {
        this.children = children;
    }

    public static class ChildrenBean implements Serializable {
        /**
         * cityCode : 00002
         * cityName : 北京
         * extString : {defaultposition=110100, zipcode=100000, pinyin=beijing_}
         * provinceCode : 00001
         */

        private String cityCode;
        private String cityName;
        private String extString;
        private String provinceCode;

        public static ChildrenBean objectFromData(String str) {

            return new Gson().fromJson(str, ChildrenBean.class);
        }

        public String getCityCode() {
            return cityCode;
        }

        public void setCityCode(String cityCode) {
            this.cityCode = cityCode;
        }

        public String getCityName() {
            return cityName;
        }

        public void setCityName(String cityName) {
            this.cityName = cityName;
        }

        public String getExtString() {
            return extString;
        }

        public void setExtString(String extString) {
            this.extString = extString;
        }

        public String getProvinceCode() {
            return provinceCode;
        }

        public void setProvinceCode(String provinceCode) {
            this.provinceCode = provinceCode;
        }
    }
}
